package com.crm.crm.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.crm.crm.domain.BusinessOpportunity;
import com.crm.crm.domain.BusinessPool;
import com.crm.crm.domain.BusinessRecord;
import com.crm.crm.domain.dto.business.*;
import com.crm.crm.domain.vo.ClueVo;
import com.crm.crm.domain.vo.PageResult;
import com.crm.crm.domain.vo.business.BusinessRecordVo;
import com.crm.crm.domain.vo.business.BusinessVo;
import org.apache.poi.ss.formula.functions.T;

import java.util.List;


public interface BusinessService extends IService<BusinessOpportunity> {

    //    商机分页查询
    Page<BusinessOpportunity> list(BusinessListDto queryDTO, Page<BusinessOpportunity> page);

    /**
     * 根据id查询客户资料详情
     *
     * @param id
     * @return
     */
    BusinessVo getBusinessDetailsById(Long id);

    Integer updateById(BusinessBatchDTO dto);

    String add(NewBusinessDto newBusinessDto);

    /**
     * 历史沟通记录列表查询
     *
     * @param id
     * @return
     */
    List<BusinessRecord> getBusinessRecordListById(Integer businessId);

    /**
     * 修改商机信息并保存沟通记录
     * @param businessMessageDto
     */
    void addAndUpdateBusiness(BusinessMessageDto businessMessageDto);

    /**
     * 删除商机
     * @param id
     */
    void deleteBusiness(Long id);

    /**
     * 踢回公海
     *
     * @param id
     * @param reasonReporting
     * @return
     */
    boolean back(Long id, String reasonReporting);

    PageResult<BusinessPool> getPage(BusinessPoolDto businessPoolDto);



//    Long selectOwner(String userName);
    String gain(BusinessBatchDTO dto);

    List<BusinessRecordVo> getRecordList(Integer id);
}
